package cn.javastudy.design._2_结构型模式._适配器模式._对象适配器模式;

/**
 * SD适配TF卡
 * 使用对象，形成聚合关系
 *
 * @author sumou
 * @date 2025/01/24
 */
public class SDAdapterTF implements SDCard {

    private final TFCard card;

    public SDAdapterTF(TFCard card) {
        this.card = card;
    }

    @Override
    public void readSDCard() {
        System.out.println("适配器读SD卡");
        card.readTFCard();
    }

    @Override
    public void writeSDCard() {
        System.out.println("适配器写SD卡");
        card.writeTFCard();
    }

}
